package cn.cvs.mapper.sysUser;

import cn.cvs.pojo.SysRole;
import cn.cvs.pojo.SysUser;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Repository;

import java.util.List;

public interface SysUserMapper {

    SysUser selectByAccount(@Param("account") String var1);

    SysUser login(@Param("account")String account,@Param("password")String password);

    List<SysUser> selectUserList(SysUser sysUser);

    /** 保存用户 */
    Integer add(SysUser sysUser);

    /*删除用户*/
    Integer delete(Integer id);

    /*修改密码*/
    Integer updatePwd(SysUser user);

    /**
     * 修改用户
     *
     * @param user
     * @return 影响的行数
     */
    Integer update(SysUser user);

    /**
     * 分页查询用户列表
     * @param realName
     * @param roleId
     * @param pageBegin
     * @param pageSize
     * @return
     */
    List<SysUser> selectList(@Param("realName")String realName,@Param("roleId")Integer roleId,@Param("pageBegin")Integer pageBegin,@Param("pageSize")Integer pageSize);

    //根据用户ID查询用户详情
    SysUser getUserById(Integer id);

    int getUserCount(@Param("realName") String queryRealName,@Param("roleId") Integer queryRoleId);

    List<SysUser> getUserList(@Param("realName") String queryRealName,@Param("roleId") Integer queryRoleId,@Param("pageIndex") Integer pageIndex,@Param("pageSize")Integer pageSize);

}
